package org.example.product.service.impl;
import org.example.product.entity.ResultBody;
import org.example.product.mapper.LoginMapper;
import org.example.product.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class LoginServiceimpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;
    //密码是否正确
    @Override
    public ResultBody checkPasswordU(String phonenumber, String password)
    {
        Map<String,Object>map=loginMapper.checkPasswordU(phonenumber,password);
        if(map!=null)
            return new ResultBody(200,"登陆成功",map);
        else
            return new ResultBody(400,"登录失败",false);
    }
    @Override
    public ResultBody checkPasswordA(String phonenumber,String password)
    {
        Map<String,Object>map=loginMapper.checkPasswordA(phonenumber,password);
        if(map!=null)
            return new ResultBody(200,"登陆成功",map);
        else
            return new ResultBody(400,"登录失败",false);
    }
}
